#FROM java:8
FROM jdk8:v1.0

MAINTAINER HXH
# 设置工作目录
WORKDIR /opt

ADD target/maintain-data-1.0-SNAPSHOT.jar maintain-data-1.0-SNAPSHOT.jar


RUN bash -c "touch maintain-data-1.0-SNAPSHOT.jar"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

EXPOSE 8300 10001 30001

ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENV JAVA_OPTS="-server "

ENV nacos_host="192.168.12.77:8848"
ENV nacos_username="nacos"
ENV nacos_password="Ikasinfo@2024qx"
ENV JAVA_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dump/heapdump_data.hprof -server -Dfile.encoding=utf-8"

# 以下两种方法启动都可以
ENTRYPOINT java ${JAVA_OPTS}  -jar maintain-data-1.0-SNAPSHOT.jar --spring.cloud.nacos.server-addr=${nacos_host} --spring.cloud.nacos.username=${nacos_username} --spring.cloud.nacos.password=${nacos_password}

# 以下两种方法启动都可以
#ENTRYPOINT java ${JAVA_OPTS} -jar -Djava.ext.dirs="$JAVA_HOME/jre/lib/ext:./:lib" maintain-data-1.0-SNAPSHOT.jar --spring.profiles.active=${spring_profiles_active} --spring.cloud.nacos.server-addr=${nacos_host}
#ENTRYPOINT  ["sh", "-c","/opt/bin/run.sh"]